package com.rinzin.exception;

import com.netflix.hystrix.contrib.javanica.command.HystrixCommandFactory;
import com.rinzin.service.UserService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @BelongsProject:microservice
 * @BelongsPackage:com.rinzin.exception
 * @Author:Rinzin
 * @CreateTime:2020-09-25-00-08
 * @Description:
 **/
@Component
public class UserServiceBackFactory implements FallbackFactory<UserService> {

    @Override
    public UserService create(Throwable cause) {
        return new UserService() {
            @Override
            public String getUser() {
                return "hehe";
            }
        };
    }
}
